package strx

import "strconv"

const (
	Octal   = 8
	Decimal = 10
	Hex     = 16
)

func Parse10Int8(s string) (int64, error) {
	return Parse10Int(s, 8)
}

func Parse10Int16(s string) (int64, error) {
	return Parse10Int(s, 16)
}

func Parse10Int32(s string) (int64, error) {
	return Parse10Int(s, 32)
}

func Parse10Int64(s string) (int64, error) {
	return Parse10Int(s, 64)
}

func Parse10Int(s string, bitSize int) (int64, error) {
	return strconv.ParseInt(s, Decimal, bitSize)
}

func Parse10Uint8(s string) (uint64, error) {
	return Parse10Uint(s, 8)
}

func Parse10Uint16(s string) (uint64, error) {
	return Parse10Uint(s, 16)
}

func Parse10Uint32(s string) (uint64, error) {
	return Parse10Uint(s, 32)
}

func Parse10Uint64(s string) (uint64, error) {
	return Parse10Uint(s, 64)
}

func Parse10Uint(s string, bitSize int) (uint64, error) {
	return strconv.ParseUint(s, Decimal, bitSize)
}
